import request from "../utils/request";

// 用户登录
export function loginApi(data: any) {
  return request({
    url: "/user/login",
    method: "post",
    data,
  });
}

// 用户注册
export function registerApi(data: any) {
  return request({
    url: "/user/register",
    method: "post",
    data,
  });
}

// 获取用户信息
export function getUserInfoApi() {
  return request({
    url: "/user/get_info",
    method: "get",
  });
}

// 退出登录
export function logoutApi() {
  return request({
    url: "/user/logout",
    method: "post",
  });
}

// 修改用户信息
export function updateUserInfoApi(data: any) {
  return request({
    url: "/user/update_user_info",
    method: "put",
    data,
  });
}

// 确认密码
export function confirmPasswordApi(data: any) {
  return request({
    url: "/user/confirm_password",
    method: "post",
    data,
  });
}
